<!DOCTYPE html>
<html>
  <head>
  <meta charset='UTF-8'>
  <title>Documentation</title>
  <script src='../javascript/application.js'></script>
  <script src='../javascript/search.js'></script>
  <link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
  <body>
    <div id='base' data-path='../'></div>
<div id='header'>
  <div id='menu'>
    <a href='../extra/README.md.html' title='../'>
      ..&#47;
    </a>
    &raquo;
    <a href='../alphabetical_index.html' title='Index'>
      Index
    </a>
    &raquo;
    <span class='title'>AppRate</span>
  </div>
</div>
    <div id='content'>
      <h1>
        Class:
        AppRate
      </h1>
      <table class='box'>
        <tr>
          <td>TypeScript defined in:</td>
          <td>typescript&#47;AppRate.d.ts</td>
        </tr>
        <tr>
          <td>CoffeeScript defined in:</td>
          <td>www_src&#47;AppRate.coffee</td>
        </tr>
      </table>
      <h2>Overview</h2>
      <div class='docstring'>
  <div class='note'>
    <strong>Note:</strong>
    All %@ patterns in customLocale object will be automatically replaced to your application title 
  </div>
  <p>AppRate plugin base class</p>
  <div class='examples'>
    <h3>Examples:</h3>
    <h4>
      Simple setup and call
    </h4>
    <pre><code class='coffeescript'>AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.preferences.storeAppURL.android = &#39;market:&#47;&#47;details?id=&lt;package_name&gt;&#39;;
AppRate.promptForRating();</code></pre>
    <h4>
      Call rate dialog immediately
    </h4>
    <pre><code class='coffeescript'>AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.promptForRating(true);</code></pre>
    <h4>
      Override dialog button callback
    </h4>
    <pre><code class='coffeescript'>var onButtonClicked = function(buttonIndex) {
  console.log(&quot;onButtonClicked -&gt; &quot; + buttonIndex);
};
AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.preferences.storeAppURL.android = &#39;market:&#47;&#47;details?id=&lt;package_name&gt;&#39;;
AppRate.preferences.callbacks.onButtonClicked = onButtonClicked;
AppRate.promptForRating();</code></pre>
    <h4>
      Set custom language
    </h4>
    <pre><code class='coffeescript'>AppRate.preferences.useLanguage = &#39;ru&#39;;
AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.preferences.storeAppURL.android = &#39;market:&#47;&#47;details?id=&lt;package_name&gt;&#39;;
AppRate.promptForRating();</code></pre>
    <h4>
      Set custom Locale object
    </h4>
    <pre><code class='coffeescript'>var customLocale = {};
customLocale.title = &quot;Rate %@&quot;;
customLocale.message = &quot;If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!&quot;;
customLocale.cancelButtonLabel = &quot;No, Thanks&quot;;
customLocale.laterButtonLabel = &quot;Remind Me Later&quot;;
customLocale.rateButtonLabel = &quot;Rate It Now&quot;;

AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.preferences.storeAppURL.android = &#39;market:&#47;&#47;details?id=&lt;package_name&gt;&#39;;
AppRate.preferences.customLocale = customLocale;
AppRate.promptForRating();</code></pre>
    <h4>
      Full setup
    </h4>
    <pre><code class='coffeescript'>var customLocale = {};
customLocale.title = &quot;Rate %@&quot;;
customLocale.message = &quot;If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!&quot;;
customLocale.cancelButtonLabel = &quot;No, Thanks&quot;;
customLocale.laterButtonLabel = &quot;Remind Me Later&quot;;
customLocale.rateButtonLabel = &quot;Rate It Now&quot;;

AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.preferences.openStoreInApp = true;
AppRate.preferences.storeAppURL.android = &#39;market:&#47;&#47;details?id=&lt;package_name&gt;&#39;;
AppRate.preferences.customLocale = customLocale;
AppRate.preferences.displayAppName = &#39;My custom app title&#39;;
AppRate.preferences.usesUntilPrompt = 5;
AppRate.preferences.promptAgainForEachNewVersion = false;
AppRate.promptForRating();</code></pre>
    <h4>
      Callbacks setup and use custom rate-dialog
    </h4>
    <pre><code class='coffeescript'>var onRateDialogShow = function(callback) {
  console.log(&quot;onRateDialogShow&quot;);
  &#47;&#47; call this callback when user click on button into your custom rate-dialog
  &#47;&#47; for example: simulate click on &quot;Rate now&quot; button and display store
  callback(3)
};
var onButtonClicked = function(buttonIndex) {
  console.log(&quot;onButtonClicked -&gt; &quot; + buttonIndex);
};

AppRate.preferences.storeAppURL.ios = &#39;&lt;my_app_id&gt;&#39;;
AppRate.preferences.useCustomRateDialog = true;
AppRate.preferences.callbacks.onRateDialogShow = onRateDialogShow;
AppRate.preferences.callbacks.onButtonClicked = onButtonClicked;

&#47;&#47; True param show rate-dialog immediately and useful for testing or custom logic
AppRate.promptForRating(true);</code></pre>
  </div>
</div>
<div class='tags'>
</div>
      <h2>Variables Summary</h2>
      <dl class='constants'>
  <dt id='locales-variable'>
    locales
    =
  </dt>
  <dd>
    <pre><code class='coffeescript'>Locales</code></pre>
    
  </dd>
  <dt id='preferences-variable'>
    preferences
    =
  </dt>
  <dd>
    <pre><code class='coffeescript'>{
  useLanguage: null,
  displayAppName: &#39;&#39;,
  promptAgainForEachNewVersion: true,
  usesUntilPrompt: 3,
  openStoreInApp: false,
  useCustomRateDialog: false,
  callbacks: {
    onButtonClicked: null,
    onRateDialogShow: null
  },
  storeAppURL: {
    ios: null,
    android: null,
    blackberry: null,
    windows8: null
  },
  customLocale: null
}</code></pre>
    
  </dd>
</dl>
      <h2>Class Method Summary</h2>
      <ul class='summary'>
  <li>
    <span class='signature'>
      <a href='#init-static'>
        .
(AppRate)
<b>init</b><span>()</span>
      </a>
    </span>
    <span class='desc'>
      Initialize 
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='#promptForRating-static'>
        .
(AppRate)
<b>promptForRating</b><span>(immediately = false)</span>
      </a>
    </span>
    <span class='desc'>
      Check plugin preferences and display or not display rate popup 
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='#navigateToAppStore-static'>
        .
(AppRate)
<b>navigateToAppStore</b><span>()</span>
      </a>
    </span>
    <span class='desc'>
      Open application page in store 
    </span>
  </li>
</ul>
      <h2>Class Method Details</h2>
      <div class='methods'>
  <div class='method_details'>
    <p class='signature' id='init-static'>
      .
(AppRate)
<b>init</b><span>()</span>
      <br>
    </p>
    <div class='docstring'>
  <p>Initialize</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      <tt><a href='../class/AppRate.html'>AppRate</a></tt>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='promptForRating-static'>
      .
(AppRate)
<b>promptForRating</b><span>(immediately = false)</span>
      <br>
    </p>
    <div class='docstring'>
  <p>Check plugin preferences and display or not display rate popup</p>
  <div class='examples'>
    <h3>Examples:</h3>
    <h4>
      
    </h4>
    <pre><code class='coffeescript'>AppRate.promptForRating();</code></pre>
  </div>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='name'>immediately</span>
      <span class='type'>
        (
          <tt>Boolean</tt>
        )
      </span>
      &mdash;
      <span class='desc'>open rate dialog immediately </span>
    </li>
  </ul>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      <tt><a href='../class/AppRate.html'>AppRate</a></tt>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='navigateToAppStore-static'>
      .
(AppRate)
<b>navigateToAppStore</b><span>()</span>
      <br>
    </p>
    <div class='docstring'>
  <p>Open application page in store</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      <tt><a href='../class/AppRate.html'>AppRate</a></tt>
    </li>
  </ul>
</div>
  </div>
</div>
    </div>
    <div id='footer'>
  February 07, 15 14:33:53 by
  <a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
    Codo
  </a>
  2.0.9
  &#10034;
  Press H to see the keyboard shortcuts
  &#10034;
  <a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
  &#10034;
  <a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
  <input type='text'>
  <ol></ol>
</div>
<div id='help'>
  <p>
    Quickly fuzzy find classes, mixins, methods, file:
  </p>
  <ul>
    <li>
      <span>T</span>
      Open fuzzy finder dialog
    </li>
  </ul>
  <p>
    Control the navigation frame:
  </p>
  <ul>
    <li>
      <span>L</span>
      Toggle list view
    </li>
    <li>
      <span>C</span>
      Show class list
    </li>
    <li>
      <span>I</span>
      Show mixin list
    </li>
    <li>
      <span>F</span>
      Show file list
    </li>
    <li>
      <span>M</span>
      Show method list
    </li>
    <li>
      <span>E</span>
      Show extras list
    </li>
  </ul>
  <p>
    You can focus and blur the search input:
  </p>
  <ul>
    <li>
      <span>S</span>
      Focus search input
    </li>
    <li>
      <span>Esc</span>
      Blur search input
    </li>
  </ul>
</div>
  </body>
</html>